package com.easylinkin.linkappapi.shigongyun.controller;

import com.easylinkin.linkappapi.shigongyun.service.EnterpriseEditionBiService;
import com.easylinkin.linkappapi.shigongyun.vo.DeviceCountVo;
import com.easylinkin.linkappapi.shigongyun.vo.LaborAttendanceVo;
import com.easylinkin.linkappapi.shigongyun.vo.TenantProjectCountVo;
import com.easylinkin.linkappapi.shigongyun.vo.UserClockGateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.morn.rest.RestMessage;

/**
 * 企业版数据大屏接口
 *
 * @author zhengwen
 */
@Slf4j
@Api(value = "企业版数据大屏", tags = {"企业版数据大屏接口"})
@RestController
@RequestMapping("/enterpriseEditionBi")
public class EnterpriseEditionBiController {

    @Autowired
    private EnterpriseEditionBiService enterpriseEditionBiService;

    /**
     * 劳务出勤数据
     *
     * @param laborAttendanceVo 劳务出勤数据vo
     * @return 统一出参
     */
    @PostMapping("/laborAttendanceData")
    @ApiOperation("劳务出勤态势")
    public RestMessage laborAttendanceData(@RequestBody LaborAttendanceVo laborAttendanceVo) {
        log.info("--劳务出勤态势--");
        return enterpriseEditionBiService.laborAttendanceData(laborAttendanceVo);
    }

    /**
     * 智能设备数
     *
     * @param deviceCountVo 设备条件vo
     * @return 统一出参
     */
    @PostMapping("/deviceTypeNumData")
    @ApiOperation("智能设备数")
    public RestMessage deviceTypeNumData(@RequestBody DeviceCountVo deviceCountVo) {
        log.info("--智能设备数数据--");
        return enterpriseEditionBiService.deviceTypeNumData(deviceCountVo);
    }

    /**
     * 疫情防控数据
     *
     * @param userClockGateVo 工地疫情防控条件vo
     * @return 统一出参
     */
    @PostMapping("/userClockGateData")
    @ApiOperation("疫情防控")
    public RestMessage userClockGateData(@RequestBody UserClockGateVo userClockGateVo) {
        log.info("--疫情防控数据--");
        return enterpriseEditionBiService.userClockGateData(userClockGateVo);
    }

    /**
     * 项目统计与优创统计
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/projectCountAndClassData")
    @ApiOperation("项目统计与优创统计")
    public RestMessage projectCountAndClassData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--项目统计与优创统计--");
        return enterpriseEditionBiService.projectCountAndClassData(tenantProjectCountVo);
    }

    /**
     * 项目类型数量统计
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/projectTypeCountData")
    @ApiOperation("项目类型数量统计")
    public RestMessage projectTypeCountData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--项目类型数量统计--");
        return enterpriseEditionBiService.projectTypeCountData(tenantProjectCountVo);
    }

    /**
     * 产值完成情况
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/outputEndData")
    @ApiOperation("产值完成情况")
    public RestMessage outputEndData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--产值完成情况--");
        return enterpriseEditionBiService.outputEndData(tenantProjectCountVo);
    }

    /**
     * 安全生产态势数据
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/safeProductionData")
    @ApiOperation("安全生产态势数据")
    public RestMessage safeProductionData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--安全生产态势数据--");
//        return enterpriseEditionBiService.safeProductionData(tenantProjectCountVo);
        return enterpriseEditionBiService.safeProductionData2(tenantProjectCountVo);
    }

    /**
     * 项目进展统计
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/projectStatueCountData")
    @ApiOperation("项目进展统计")
    public RestMessage projectStatueCountData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--项目进展统计--");
        return enterpriseEditionBiService.projectStatueCountData(tenantProjectCountVo);
    }

    /**
     * 项目弹框展示信息
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/projectInfoData")
    @ApiOperation("项目信息")
    public RestMessage projectInfoData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--项目弹框展示信息--");
//        return enterpriseEditionBiService.projectInfoData(tenantProjectCountVo);
        return enterpriseEditionBiService.projectInfoData2(tenantProjectCountVo);
    }

    /**
     * 行政省市树形项目统计
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/manageAreaProjectData")
    @ApiOperation("行政省市树形项目统计")
    public RestMessage manageAreaProjectData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--行政省市树形项目统计--");
        return enterpriseEditionBiService.manageAreaProjectData(tenantProjectCountVo);
    }

    /**
     * 行政省市树形项目统计
     *
     * @param tenantProjectCountVo 租户项目条件vo
     * @return 统一出参
     */
    @PostMapping("/projectHeatMapData")
    @ApiOperation("项目热力图数据")
    public RestMessage projectHeatMapData(@RequestBody TenantProjectCountVo tenantProjectCountVo) {
        log.info("--项目热力图数据--");
        return enterpriseEditionBiService.projectHeatMapData(tenantProjectCountVo);
    }

}
